<template>
  <div>
    <el-dialog
      title="提示"
      :visible="videoDialogVisible"
      width="20%"
      @close="onClose"
    >
      <video muted autoplay controls loop class="video" :src="url"></video>
      <i class="el-icon-circle-close i" @click="onClose"></i>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    videoDialogVisible: {
      type: Boolean,
      required: true
    },
    url: {
      required: true
    }
  },
  data () {
    return {

    }
  },

  created () {

  },

  methods: {
    onClose () {
      this.$emit('on-close')
    }
  }
}
</script>

<style scoped lang='less'>
.el-dialog {
  position: relative;
}
.video {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
}
.i {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  text-align: center;
  line-height: 50px;
  background-color: rgba(0,0,0,.6);
  color: #fff;
  border-radius: 50%;
  font-size: 30px;
}
</style>
